import authTokenBuilder from '../authHeaderBuilder';

test('token build', () => {
	expect(
		authTokenBuilder(
			'5ce67dd406d7789d205c4283',
			'638bdb58f6a34eed9650557ce7e735cb',
			[
				[
					'data',
					'[{"type":"http","target":"http://hao.cnfol.com/index.html","server_ip":"222.23.2.23"}]',
				],
				['time', 1583380000],
			]
		)
	).toBe(
		'Basic NWNlNjdkZDQwNmQ3Nzg5ZDIwNWM0MjgzOmFlNWI3OTEzZjk2MTA2OWY2MDk2MDc2MTllNmFlMTcxMGZlNTVlYmY='
	);
});

test.skip('multi same key', () => {
	expect(
		authTokenBuilder(
			'5ce67dd406d7789d205c4283',
			'638bdb58f6a34eed9650557ce7e735cb',
			[
				['a', 1],
				['a', 2],
				['a', 3],
			]
		)
	).toBe(
		'Basic NWNlNjdkZDQwNmQ3Nzg5ZDIwNWM0MjgzOmFlNWI3OTEzZjk2MTA2OWY2MDk2MDc2MTllNmFlMTcxMGZlNTVlYmY='
	);
});
